/**
 * fileName: Page.java
 *     Date: 2012-4-28
 **/
package com.stranger.common.util;

import java.util.List;

/**
 * @作者 stranger.lin
 *
 * @时间 2012-4-28
 */
public class Pager {

	private int page;//当前页码
	private int records;//返回记录数
	private int pageSize;//每一页的大小

	private List<?> rows;//返回结果
	private int total;//总共页数
	private int currentRecord;//当前记录
	

	public int getPage() {
		return page;
	}



	public void setPage(int page) {
		this.page = page;
	}



	public int getRecords() {
		
		return records;
	}



	public void setRecords(int records) {
		this.records = records;
	}



	






	@SuppressWarnings("unchecked")
	public List getRows() {
		return rows;
	}



	@SuppressWarnings("unchecked")
	public void setRows(List rows) {
		this.rows = rows;
	}






	public int getPageSize() {
		return pageSize;
	}



	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}



	public int getTotal() {
		total=records/pageSize;
		int temp=records%pageSize;
		if (temp==0) {
			return total;
		}
		return total+1;
	}



	public void setTotal(int total) {
		this.total = total;
	}



	public int getCurrentRecord() {
		currentRecord=(page-1)*pageSize;
		return currentRecord;
	}




	
	
}
